import './App.css';
import React from 'react';
import Toolbar from "./Toolbar";
import { connect } from 'react-redux';
import RecGrowthForm from "./Components/RecGrowthForm";
import { NavBar, Icon } from 'antd-mobile';


class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            childData: [],
        }
    }
    componentDidMount() {

    }
    componentWillUnmount = () => {
        this.setState = () => {
            return;
        };
    }
    render() {
        const { currentChild } = this.props;
        return (
            <div>
                <NavBar
                    mode="light"
                    icon={<Icon type="left" />}
                    onLeftClick={() => this.props.history.push('/Growth')}
                >{currentChild.name}</NavBar>
                <RecGrowthForm state={this.props} />
                <Toolbar history={this.props.history} />
            </div>
        )
    };
}
export default connect(
    state => ({ currentUser: state.setCurrentUser, currentChild: state.setCurrentChild })
)(App)
